package com.ycw.controller.cjy;

import javax.servlet.http.HttpSession;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.ycw.bean.BasicInfo;
import com.ycw.bean.Users;
import com.ycw.service.xiaocai.BasicinfoService;
import com.ycw.util.Msg;

@Controller
public class BasicinfoController {

    @Autowired
    BasicinfoService basicinfoService;
    
    //1.根据输入的用户名和身份证查询用户id
	//2.基本信息表的添加
	@RequestMapping(value = "/insertBasic",method = RequestMethod.POST)
	@ResponseBody
	public Msg insertBasic(BasicInfo basicInfo,Users users,HttpSession session) {
		session.setAttribute("basicInfo", basicInfo);
		System.out.println("=="+users.getUsIdcard());
		//Integer usersId=basicinfoService.getUsersId(users);
		//System.out.println("usersId:"+usersId);
		//basicInfo.setBasicinfoUsId(usersId);
		boolean f=basicinfoService.insertBasic(basicInfo);
		if (f) {
			System.out.println("插入成功");
			return Msg.success();
		}
		return Msg.fail();
	}
}
